<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>sp2adj</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : JUN 1997</div>
    <p>
      <b>sp2adj</b> -  converts sparse matrix into adjacency form</p>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>A</b>
        </tt>:  real or complex sparse matrix (nz non-zero entries)</li>
      <li>
        <tt>
          <b>xadj</b>
        </tt>:  integer vector of length (n+1).</li>
      <li>
        <tt>
          <b>adjncy</b>
        </tt>:  integer vector of length nz containing the row indices     for the corresponding elements in anz</li>
      <li>
        <tt>
          <b>anz</b>
        </tt>:  column vector of length nz, containing the non-zero     elements of A</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <pre>

sp2adj converts a sparse matrix into its adjacency form (utility
fonction).
A =  n x m sparse matrix. xadj, adjncy, anz = adjacency 
representation of A i.e:
   
    </pre>
    <p>
      <tt>
        <b>xadj(j+1)-xadj(j)</b>
      </tt> = number of non zero entries in row j.
    <tt>
        <b>adjncy</b>
      </tt> = column index of the non zeros entries 
    in row 1, row 2,..., row n.
    <tt>
        <b>anz</b>
      </tt> = values of non zero entries in row 1, row 2,..., row n.
    <tt>
        <b>xadj</b>
      </tt> is a (column) vector of size n+1 and 
    <tt>
        <b>adjncy</b>
      </tt> is an integer (column) vector of size <tt>
        <b>nz=nnz(A)</b>
      </tt>.
    <tt>
        <b>anz</b>
      </tt> is a real vector of size <tt>
        <b>nz=nnz(A)</b>
      </tt>.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

A = sprand(100,50,.05);
[xadj,adjncy,anz]= sp2adj(A);
[n,m]=size(A);
p = adj2sp(xadj,adjncy,anz,[n,m]);
A-p,
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="adj2sp.htm">
        <tt>
          <b>adj2sp</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="sparse.htm">
        <tt>
          <b>sparse</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="spcompack.htm">
        <tt>
          <b>spcompack</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="spget.htm">
        <tt>
          <b>spget</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
